package com.ruoyi.ora.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ora.mapper.DeviceMigrationMapper;
import com.ruoyi.ora.domain.DeviceMigration;
import com.ruoyi.ora.service.IDeviceMigrationService;

/**
 * 设备迁移Service业务层处理
 * 
 * @author liuwp
 * @date 2025-10-12
 */
@Service
public class DeviceMigrationServiceImpl implements IDeviceMigrationService 
{
    @Autowired
    private DeviceMigrationMapper deviceMigrationMapper;

    /**
     * 查询设备迁移
     * 
     * @param id 设备迁移主键
     * @return 设备迁移
     */
    @Override
    public DeviceMigration selectDeviceMigrationById(Long id)
    {
        return deviceMigrationMapper.selectDeviceMigrationById(id);
    }

    /**
     * 查询设备迁移列表
     * 
     * @param deviceMigration 设备迁移
     * @return 设备迁移
     */
    @Override
    public List<DeviceMigration> selectDeviceMigrationList(DeviceMigration deviceMigration)
    {
        return deviceMigrationMapper.selectDeviceMigrationList(deviceMigration);
    }

    /**
     * 根据业务主键查询一条记录：设备迁移
     *
     * @param deviceMigration 设备迁移
     * @return 设备迁移
     */
    @Override
    public DeviceMigration selectOneDeviceMigration(DeviceMigration deviceMigration)
    {
        return deviceMigrationMapper.selectOneDeviceMigration(deviceMigration);
    }

    /**
     * 新增设备迁移
     * 
     * @param deviceMigration 设备迁移
     * @return 结果
     */
    @Override
    public int insertDeviceMigration(DeviceMigration deviceMigration)
    {
        deviceMigration.setCreateTime(DateUtils.getNowDate());
        return deviceMigrationMapper.insertDeviceMigration(deviceMigration);
    }

    /**
     * 修改设备迁移
     * 
     * @param deviceMigration 设备迁移
     * @return 结果
     */
    @Override
    public int updateDeviceMigration(DeviceMigration deviceMigration)
    {
        return deviceMigrationMapper.updateDeviceMigration(deviceMigration);
    }

    @Override
    public int updateDeviceMigrationCondition(DeviceMigration deviceMigration, DeviceMigration deviceMigrationCondition)
    {
        return deviceMigrationMapper.updateDeviceMigrationCondition(deviceMigration, deviceMigrationCondition);
    }

    /**
     * 批量删除设备迁移
     * 
     * @param ids 需要删除的设备迁移主键
     * @return 结果
     */
    @Override
    public int deleteDeviceMigrationByIds(Long[] ids)
    {
        return deviceMigrationMapper.deleteDeviceMigrationByIds(ids);
    }

    /**
     * 删除设备迁移信息
     * 
     * @param id 设备迁移主键
     * @return 结果
     */
    @Override
    public int deleteDeviceMigrationById(Long id)
    {
        return deviceMigrationMapper.deleteDeviceMigrationById(id);
    }

    /**
     * 条件删除设备迁移
     *
     * @param deviceMigration 设备迁移
     * @return 结果
     */
    @Override
    public int deleteDeviceMigrationByCondition(DeviceMigration deviceMigration)
    {
        return deviceMigrationMapper.deleteDeviceMigrationByCondition(deviceMigration);
    }

}
